package com.ajavaer.framework.im.tencent.request.data;

import com.fasterxml.jackson.annotation.JsonProperty;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

public class ForbidSendMsgData implements TencentImRequestData {
    /**
     * 必填	需要查询的群组 ID
     */
    @JsonProperty("GroupId")
    private String groupId;
    /**
     * 最多支持500个
     */
    @JsonProperty("Members_Account")
    private List<String> membersAccount = new ArrayList<>();
    /**
     * 禁言时间，单位为秒
     */
    @JsonProperty("ShutUpTime")
    private Long shutUpTime;

    public ForbidSendMsgData() {
    }

    public ForbidSendMsgData(String groupId, String... accounts) {
        this.groupId = groupId;
        membersAccount.addAll(Arrays.asList(accounts));
        shutUpTime = 0L;//取消禁言
    }

    /**
     * @param groupId    组ID
     * @param shutUpTime 禁言时间，单位为秒
     * @param accounts   最多支持500个
     */
    public ForbidSendMsgData(String groupId, Long shutUpTime, String... accounts) {
        this(groupId, accounts);
        this.shutUpTime = shutUpTime;
    }

    public String getGroupId() {
        return groupId;
    }

    public void setGroupId(String groupId) {
        this.groupId = groupId;
    }

    public List<String> getMembersAccount() {
        return membersAccount;
    }

    public void setMembersAccount(List<String> membersAccount) {
        this.membersAccount = membersAccount;
    }

    public Long getShutUpTime() {
        return shutUpTime;
    }

    public void setShutUpTime(Long shutUpTime) {
        this.shutUpTime = shutUpTime;
    }
}
